package sg.edu.nus.iss.vmcs.command;

import sg.edu.nus.iss.vmcs.customer.ChangeGiver;

/**
 * 
 * @version 1.0
 * @author Qu Hui
 * 
 */
public class GiveChangeCmd implements Command {

	private ChangeGiver changeGiver;
	private Boolean changeGiven;
	
	public GiveChangeCmd(ChangeGiver changeGiver) {
		this.changeGiver = changeGiver;
	}
	
	public void execute(Object o) {
		if (o instanceof Integer) {
			Integer changeRequired = (Integer) o;
			changeGiven = changeGiver.giveChange(changeRequired);
		}
	}
	
	public Boolean getChangeGiven() {
		return changeGiven;
	}
}
